19.2 AT+CALA Set alarm timeThe AT+CALA write command can be used to set an alarm time in the ME or to clear a programmed alarm. When the alarm time is reached and the alarm is executed the ME returns an Unsolicited Result Code (URC) and the alarm time is reset to "00/01/01,00:00:00".
The alarm can adopt two functions, depending on whether or not you switch the GSM engine off after setting the alarm:
• Reminder message: You can use the alarm function to generate reminder messages. For this purpose, set the alarm as described below and do not switch off or power down the ME. When executed the message comes as an Unsolicited Result Code which reads "+CALA".
• Airplane mode: The alarm function can be used to wake up the ME at a scheduled time. For this purpose, set the alarm as described below. Then power down the ME by entering the AT^SMSO command. When the alarm time is reached the ME enters the Airplane mode, notified to the user by the URC "^SYSSTART AIRPLANE MODE" and, if available, by a user defined text message (specified with <text>). In Airplane mode, the RF interface of the ME is shut down to prevent it from unintentionally logging into the GSM network. All AT commands whose execution requires a radio connection are disabled. A list of AT commands supported during Airplane mode can be found in Section 23.4, Availability of AT Commands Depending on Operating Mode of ME. To return from Airplane mode to Normal mode use the AT^SCFG command and set the parameter <map> to "off". This immediately activates the RF interface and restores access to all AT commands. The URC "^SYSSTART" notifies the user that the ME has returned to Normal mode. Please note that setting an alarm with AT+CALA is one method to wake up into Airplane mode. The second approach is using the AT^SCFG command, parameter <mapos>. For further detail on Airplane mode refer to Section 2.14, AT^SCFG.The AT+CALA test command returns the supported array index values <n>, the supported alarm types <type> and the maximum length of the text <tlength> to be output.
The AT+CALA read command returns the current alarm settings in the ME.
GSM 07.07 Indicates reminder message.
After power-down and wake-up at the scheduled time, the following URC indicates that the ME has entered the Airplane mode:
"^SYSSTART AIRPLANE MODE"
+CALA: [<text>]
<time>(str)Format is "yy/MM/dd,hh:mm:ss". For example, 6th of July 2005, 22:10:00 equals to "05/07/06,22:10:00" (see also AT+CCLK).
Note: If <time> equals current date and time or is set to an earlier date, TA returns +CME ERROR: 21.
To clear a given alarm before its scheduled time simply enter an empty string for parameter <time>. See examples below.
<n>(num)Integer type value indicating the array index of the alarm.
The ME allows to set only one alarm at a time. Therefore, the list of supported alarm events indicated by the test command AT+CALA=? is <n>=0. If a second alarm time is set, the previous alarm will be deleted. Therefore, the read command AT+CALA? will always return <n>=0. This is also true if individual settings are made on ASC0 and ASC1 or the various Multiplexer channels, for details see notes below.
<type>(num)
<text>(str)String type value indicating the text to be displayed when alarm time is reached; maximum length is <tlength>. By factory default, <text> is undefined.
Note: <text> will be stored to the non-volatile flash memory when the device enters the Power Down mode via AT^SMSO. Once saved, it will be available upon next power-up, until you overwrite it by typing another text. This eliminates the need to enter the full string when setting a fresh alarm.
<text> should not contain characters which are coded differently in ASCII and GSM (e.g. umlauts), see also "Supported character sets" and "GSM alphabet tables".
<tlength>(num)Integer type value indicating the maximum length of <text>. The maximum length is 16.
• After the alarm was executed the parameter <time> of AT+CALA will be reset to "00/01/01,00:00:00", but <text> will be preserved as described above.
• If TC65 is totally disconnected from power supply the most recently saved configuration of +CALA: <time>[,<n>[,<type>[,<text>]]] will be presented when TC65 is powered up.
• Each time TC65 is restarted with ignition it takes 2s to re-initialize the RTC and to update the current time. Therefore, it is recommended to wait 2s before using the commands AT+CCLK and AT+CALA (for example 2s after ^SYSSTART has been output).
- On each interface an individual <text> message can be stored, but only one time setting applies. This means an alarm <time> set on one of the interfaces overwrites the time setting on all remaining interfaces. Therefore, the total number of alarm events returned by the read command AT+CALA? will always be <n>=0, no matter whether different text messages are stored.
- When the scheduled alarm occurs, the ME sends the URC only on the interface where the most recent alarm setting was made. The alarm time will be reset to "00/01/01,00:00:00" on all interfaces.
EXAMPLE 1
EXAMPLE 2
When the alarm is executed the ME wakes up to Airplane mode and displays a URC. If available, this line is followed by the individual <text> most recently saved. If no individual message was saved only the first line appears.
EXAMPLE 4
|